cmake_minimum_required(VERSION 3.14)
project(SubtractOp)

# 获取CANN安装路径
set(CANN_ROOT $ENV{ASCEND_HOME})
if (NOT CANN_ROOT)
    message(FATAL_ERROR "ASCEND_HOME environment variable is not set.")
endif()

# 添加头文件路径
include_directories(${CANN_ROOT}/include)

# 编译共享库（减法算子实现）
add_library(subtract_op SHARED subtract.cpp)
target_link_directories(subtract_op PRIVATE ${CANN_ROOT}/lib64)
target_link_libraries(subtract_op op_api tiling)  # 链接分块相关库